<div class="col-sm-1 col-md-2 sidebar">
    <ul class="nav nav-sidebar">
        {% for role in request.user.roles.all %}
            {% for menu in role.menus.all %}
                <li>
                    {% if menu.url_type == 0 %}
                        <a href="{% url menu.url_name %}">{{ menu.name }}</a>
                    {% else %}
                        <a href="{{ menu.url_name }}">{{ menu.name }}</a>
                    {% endif %}

                </li>
            {% endfor %}
        {% endfor %}
    </ul>
</div>